#!/bin/bash - 
#===============================================================================
#
#          FILE:  ex9-10.sh
# 
#         USAGE:  ./ex9-10.sh 
# 
#   DESCRIPTION:  using declare to type variables
# 
#       OPTIONS:  ---
#  REQUIREMENTS:  ---
#          BUGS:  ---
#         NOTES:  ---
#        AUTHOR: bucunzai (), freecityer@gmail.com
#       COMPANY: FreeCity
#       CREATED: 2011年02月04日 20时45分50秒 CST
#      REVISION:  ---
#===============================================================================

set -o nounset                              # Treat unset variables as an error

func1(){
    echo "This is a function."
}
declare -f
echo

declare -i var1
var1=2324
echo "var1 declared as $var1"
var1=var1+1
echo "var1 incremented by 1 is $var1"

# Attempt to change var1 to floating point value
echo "Attempting to change var1 datatype to floating point value"
var1=2367.1
echo "var1 is $var1"

echo

declare -r var2=13.35
echo "var2 declared as $var2"
var2=13.36
echo "var2 is still $var2"

exit 0
